package hw;

import java.io.File;

public class FileChangesWatcher {
	private File fileToWatch;
	private long lastModified;

	public FileChangesWatcher(File f) {
		fileToWatch = f;
		lastModified = fileToWatch.lastModified();
	}
	
	public boolean hasChanged() {
		long currLastModified = fileToWatch.lastModified();
		boolean result = (lastModified!=currLastModified);
		lastModified=currLastModified;
		return result;
	}
	
	public File getFile() {
		return fileToWatch;
	}

}
